﻿
using Cms.Core.Data.Mapping;
using Cms.Core.Data.Model;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Text;

namespace Cms.Core.Data.Configurations
{
    public class SysPermissionConfigurations : EntityMappingConfiguration<SysPermission>
    {
    

        public override void Map(EntityTypeBuilder<SysPermission> builder)
        {

            base.MapCommon(builder);
            builder.Property(o => o.Name).HasColumnType("nvarchar(200)").IsRequired(true);
            builder.Property(o => o.Code).HasColumnType("nvarchar(50)").IsRequired(false);
            builder.Property(o => o.ParentId);
            builder.Property(o => o.Icon).HasColumnType("nvarchar(100)").IsRequired(false); ;
            builder.Property(o => o.Description).HasColumnType("nvarchar(1000)").IsRequired(false);
            builder.Property(o => o.OrderSort).HasDefaultValue(0);
            builder.Property(o => o.IsEnabled).HasDefaultValue(true).IsRequired(true);
            builder.Property(o => o.Type);
            builder.Property(o => o.Level).HasDefaultValue(0);
            builder.Property(o=>o.IsDisplay).HasDefaultValue(true);
            builder.Property(o =>o.Action).HasColumnType("varchar(50)").IsRequired(false);
            builder.ToTable("SysPermission");
        }

     
    }
}
